function fixedStringLength(str){
    let newStr = str;
    if (newStr.length < 10){
        return newStr;
    } else {
        newStr = newStr.substring(0, 10) + "...";
        return newStr;
    }
}

function formatDate(date){
    return date.replace("T", " ").substring(0, date.lastIndexOf("."));
}

function setExercise(exercise) {
    let map = new Map;
    exercise = exercise.substring(9, exercise.lastIndexOf(")"));
    let s = exercise.split(",");
    for (const key in s) {
        let attr = s[key];
        let attrKey = attr.split("=")[0].trim();
        let attrValue = attr.split("=")[1];
        map.set(attrKey, attrValue);
    }
    //console.log(map);
    return map;
}

function back(){
    history.back();
}